package vno.fux.character
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.utils.Dictionary;
	
	import vno.fux.BaseDisplayObject;
	import vno.fux.BasePoint;

	public class PlayerLayer extends BaseDisplayObject
	{
		private var _players:Dictionary;
		private var _mainPlayerLayer:MainPlayerLayer;
		private var _otherPlayerLayer:OtherPlayerLayer;
		private var _layerView:Sprite;
		private var _settings:XMLList;
		public function PlayerLayer(_settings:XMLList)
		{
			_layerView = new Sprite;
			_layerView.mouseEnabled = false;
			_mainPlayerLayer = new MainPlayerLayer();
			//_otherPlayerLayer = new OtherPlayerLayer(_settings.otherPlayer);
			//_layerView.addChild(_otherPlayerLayer);
			_layerView.addChild(_mainPlayerLayer);
			this.content = _layerView;
			this.mouseEnabled = false;
		}
		public function mapMove(pos:BasePoint):void
		{
			_otherPlayerLayer.setRegPoint(pos);
		}
		
		public function changeDirection(direction:String):void
		{
			// TODO Auto Generated method stub
			_mainPlayerLayer.changeDirection(direction);
		}
		
		public function moveStateHandle(moveState:String):void
		{
			// TODO Auto Generated method stub
			_mainPlayerLayer.moveStateHandle(moveState);
		}

		public function get mainPlayer():MainPlayerLayer
		{
			return _mainPlayerLayer;
		}

		public function handleCover(roadValue:int):void
		{
			if(roadValue == 0)
			{
				_mainPlayerLayer.alpha = 1;
				return;
			}
			if(roadValue == 2)
			{
				_mainPlayerLayer.alpha = 0.5;
				return;
			}	
		}
	}
}